<h1>Language specific notes</h1>

<h2>C</h2>
<ul>
 <li>C code is compiled with gcc, by default <em>without</em> the <tt>--ansi</tt> flag.
     So GNU extensions are enabled.</li>
</ul>

<h2>Java</h2>
<ul>
 <li>The name of the main class is detected automatically:
     <ul>
       <li>Only classes with a <tt>main</tt> method are considered.</li>
       <li>If there is a class with the same name as the source file, then that one is used.</li>
       <li>In case of ambiguity an error is reported.</li>
     </ul>
 </li>
</ul>


<h2>Matlab</h2>
<ul>
 <li>"<tt>.m</tt>" files are run using <a href="http://www.gnu.org/software/octave/">octave</a> instead of matlab.
     Octave should be compatible, but there may be some issues with uncommon functions.</li>
 <li>A <tt>.m</tt> file can be either a function or a stand alone script.</li>
 <li>For running stand alone scripts, an empty file called "<tt>run-script.in</tt>" should be made.
     The script will be run and the output compared.
     The info file should include the attribute
<pre>language: matlab-script</pre>
 <li>For functions, the info file must include the attribute
<pre>language: matlab-function</pre>
     Now multiple <a href="/documentation.php/courses/test_cases">test case inputs</a> can be made.
     Such an input file should be a script that calls the function to be tested.
     For example:
<pre>
function_to_test(1,2)
function_to_test(1,3)
function_to_test(2,4)
</pre>
     This script is then run in the same directory as the tested function, and the output is compared.
 </li>
 <!-- <li>Justitia tries to detect the name of the submitted function, and makes it available under the name "<tt>the_function</tt>".
     So the above could be written
<pre>
the_function(1,2)
the_function(1,3)
the_function(2,4)
</pre>
     Which will work regardless of the filename
 </li>-->
 <!--<li>The default diff command is strict when comparing numbers.
 <br>Specify (for instance)
<pre style="margin:0;">
checker flags: -@TODO@-absolute-error 1e-6
</pre>
   To ignore numerical differences smaller than <em>10<sup>-6</sup></em> in absolute value, i.e. <em>|x-y| < &epsilon;</em>.
   <br><br>Specify (for instance)
<pre style="margin:0;">
checker flags: -@TODO@-relative-error 1e-6
</pre>
   To ignore numerical differences smaller than <em>10<sup>-6</sup></em> in relative value, i.e. <em>1-&epsilon; < |x/y| < 1+&epsilon;</em>.
   <br><br>It can also be useful to ignore additional output, for cases where students forget to include a semicolon.
   TODO!!
 </li>-->
</ul>
